package com.yyx.schoolmusicweb.controller.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


@Controller
@RequestMapping("/admin")
public class AdminController {
	
	@RequestMapping()
    public String Admin(HttpServletRequest request, HttpServletResponse response) throws Exception {
    	return "afterview/user/login";
    	
    }
	
	@RequestMapping(value = "{pageName1}", method = RequestMethod.GET)
    public ModelAndView toPage(@PathVariable("pageName1") String pageName1) {
    	ModelAndView mv = new ModelAndView(pageName1);
    	return mv;
    }
	
	@RequestMapping(value = "{pageName1}/{pageName2}", method = RequestMethod.GET)
    public ModelAndView toPage(@PathVariable("pageName1") String pageName1,@PathVariable("pageName2") String pageName2) {
    	ModelAndView mv = new ModelAndView(pageName1+"/"+pageName2);
    	return mv;
    }
	
	@RequestMapping(value = "{pageName1}/{pageName2}/{pageName3}", method = RequestMethod.GET)
    public ModelAndView toPage(@PathVariable("pageName1") String pageName1,@PathVariable("pageName2") String pageName2,@PathVariable("pageName3") String pageName3) {
    	ModelAndView mv = new ModelAndView(pageName1+"/"+pageName2 + "/" + pageName3);
    	return mv;
    }
	
	

}
